﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<UserControl x:Class="System.Windows.Controls.Samples.DataGridMasterDetailSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:datagrid="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns:dataform="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
    xmlns:input="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
    xmlns:desc="clr-namespace:System.Windows.Data;assembly=System.Windows">
    <StackPanel>
        <ContentControl Content="DataGrid, DataForm, and DataPager provide a Master-Details UI" Style="{StaticResource Header}" />
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="2*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid Margin="4">
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <datagrid:DataGrid ItemsSource="{Binding}">
                </datagrid:DataGrid>
                <datagrid:DataPager Grid.Row="1" Source="{Binding}" PageSize="10" />
            </Grid>
            <dataform:DataForm Margin="4" Grid.Column="1" ItemsSource="{Binding}">
            </dataform:DataForm>
        </Grid>
        <src:SourceViewer xmlns:src="clr-namespace:System.Windows.Controls.Samples;assembly=System.Windows.Controls.Samples.Common" xmlns:sys="clr-namespace:System;assembly=mscorlib">
  <src:SourceFile Path="DataGridMasterDetailSample.xaml">
    <src:SourceFile.Source>
      <sys:String>&lt;!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
--&gt;

&lt;UserControl x:Class="System.Windows.Controls.Samples.DataGridMasterDetailSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:datagrid="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns:dataform="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
    xmlns:input="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
    xmlns:desc="clr-namespace:System.Windows.Data;assembly=System.Windows"&gt;
    &lt;StackPanel&gt;
        &lt;ContentControl Content="DataGrid, DataForm, and DataPager provide a Master-Details UI" Style="{StaticResource Header}" /&gt;
        &lt;Grid&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition Width="2*" /&gt;
                &lt;ColumnDefinition Width="*" /&gt;
            &lt;/Grid.ColumnDefinitions&gt;
            &lt;Grid Margin="4"&gt;
                &lt;Grid.RowDefinitions&gt;
                    &lt;RowDefinition /&gt;
                    &lt;RowDefinition Height="Auto" /&gt;
                &lt;/Grid.RowDefinitions&gt;
                &lt;datagrid:DataGrid ItemsSource="{Binding}"&gt;
                &lt;/datagrid:DataGrid&gt;
                &lt;datagrid:DataPager Grid.Row="1" Source="{Binding}" PageSize="10" /&gt;
            &lt;/Grid&gt;
            &lt;dataform:DataForm Margin="4" Grid.Column="1" ItemsSource="{Binding}"&gt;
            &lt;/dataform:DataForm&gt;
        &lt;/Grid&gt;
    &lt;/StackPanel&gt;
&lt;/UserControl&gt;
</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
  <src:SourceFile Path="DataGridMasterDetailSample.xaml.cs">
    <src:SourceFile.Source>
      <sys:String>// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System.ComponentModel;
using System.Windows.Data;

namespace System.Windows.Controls.Samples
{
    /// &lt;summary&gt;
    /// Sample page that demonstrates using a DataGrid, DataForm, and DataPager
    /// to create a paged Master-Details view.
    /// &lt;/summary&gt;
    [Sample("Master-Details with DataGrid and DataForm", DifficultyLevel.Scenario)]
    [Category("DataGrid")]
    public partial class DataGridMasterDetailSample : UserControl
    {
        /// &lt;summary&gt;
        /// Initializes a DataGridMasterDetailsSample.
        /// &lt;/summary&gt;
        public DataGridMasterDetailSample()
        {
            InitializeComponent();
            PagedCollectionView pcv = new PagedCollectionView(Contact.People);
            DataContext = pcv;
        }
    }
}
</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
  <src:SourceFile Path="DataGridMasterDetailSample.xaml.vb">
    <src:SourceFile.Source>
      <sys:String>' (c) Copyright Microsoft Corporation.
' This source is subject to the Microsoft Public License (Ms-PL).
' Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
' All other rights reserved.

Imports System.Windows.Data
Imports System.ComponentModel

''' &lt;summary&gt;
''' Sample page that demonstrates using a DataGrid, DataForm, and DataPager
''' to create a paged Master-Details view.
&lt;Sample("Master-Details with DataGrid and DataForm", DifficultyLevel.Scenario)&gt; _
&lt;Category("DataGrid")&gt; _
Public Class DataGridMasterDetailSample
    Inherits UserControl

    ''' &lt;summary&gt;
    ''' Initializes a DataGridMasterDetailsSample.
    ''' &lt;/summary&gt;
    Public Sub New()
        InitializeComponent()
        Dim pcv As PagedCollectionView = New PagedCollectionView(Contact.People)
        DataContext = pcv
    End Sub
End Class
</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
</src:SourceViewer>
    </StackPanel>
</UserControl>
